package bookpos.action;

import java.util.List;

import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import bookpos.service.LedgerService;
import bookpos.util.core.action.BaseAction;
import bookpos.vo.BookTypeLedger;
import bookpos.vo.MonthLedger;
/**
 * 库存控制器 InventoryAction
 * @author WZB
 *
 */
@Controller
@Action(value = "ledger", results = { @Result(name = "ledger", location = "/page/ledger/ledger.jsp") })
public class LedgerAction extends BaseAction {
	private static final long serialVersionUID = 3088843221530537631L;
	private static final Logger logger = Logger.getLogger(LedgerAction.class);
	@Autowired
	private LedgerService service;

	
	public void getMonthLedger(){
		List<MonthLedger> ml = service.findMonthLedger();
		writeJson(ml);
	}
	
	public void getBookTypeLedger(){
		List<BookTypeLedger> ml = service.findBookTypeLedger();
		writeJson(ml);
	}

}
